package com.sz.springboot_jpa.repository;

import com.sz.springboot_jpa.entity.Article;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ArticleRepository  extends CrudRepository<Article,Long> {
//    List<Article> findAll();

//    @Query("SELECT  id,title,summary,content,created  FROM Article ")
    List<Article> findAllBy();

    Optional<Article> findById(Long id);

    void deleteById(Long id);


}
